<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Login</title>
<script type="text/javascript" src="script/jquery_2.0.3.js"></script>
<script>
	$(document).ready(function(e) {
        $("#logtxt").click(function(){
			var uname=$("#nametxt").val();
			var pwd=$("#pwdtxt").val();
			if(uname!="" && pwd!=""){
				$.ajax({	
							type:"POST",
							url:"login.php",
							data:{'uname':uname,'pwd':pwd},
							success: function(html){    
            				if(html=='true'){ 
								alert("login Sucess");
							//$("#add_err").html("<img src='resource/Image/loading.gif' /> Loading...")            
             					window.location="resource/";
            				}else{
								alert("Login Fail");
							}								
							}	
																	
				});
				return false;	
			}else{
				alert("please input require field");
			}			
		});
    });
</script>

<style type="text/css">
#table{
	background: none repeat scroll 0 0 #FFFFFF;
    border: 1px solid #D6E5F5;
    border-radius: 3px 3px 3px 3px;
    height: 200px;
    margin: auto;
    padding: 0;
    width: 450px;
	margin-top:10%;
	}
</style>
</head>

<body>
<table id="table" cellpadding="0" cellspacing="30">
	<div id="add_err"></div>
    <tr>
    	<td></td><td><h2>Login</h2></td><td></td>
    </tr>
    
    <tr>
    	<td width="130" align="right">Username</td><td><input type="text" id="nametxt"></td>
    </tr>
    <tr>
    	<td align="right">Password</td><td><input type="text" id="pwdtxt"></td>
    </tr>
    <tr>
    	<td></td><td><input type="button" id="logtxt" value="Login"></td>
    </tr>
    <tr>
    	<td></td><td></td>
    </tr>
    <tr>
    	<td></td><td></td>
    </tr>
    
</table>
<div id="msg"></div>
</body>
</html>